/*
 * EventHandlingThread.cpp
 *
 *  Created on: Nov 6, 2012
 *      Author: lucas
 */

#include "EventHandlingThread.h"
#include "../common/Event.h"
#include "Client.h"
#include "Server.h"
#include <string>
#include <iostream>
EventHandlingThread::EventHandlingThread(Server &s) : server(s) {

}

void EventHandlingThread::ejecutar() {
	Event* e;
	std::string msg;
	while (this->running()) {
		e = server.receiveEvent();
		msg = e->getMessage();
		std::cout << "EventHandlingThread::ejecutar: " << msg <<std::endl;
		e->getClient().send(msg);
	}
}

EventHandlingThread::~EventHandlingThread() {
}

